Skip to main content link. Accesskey S
  • Help
  • HCL Logo
  • HCL Notes and Domino Application Development wiki
  • THIS WIKI IS READ-ONLY. Individual names altered for privacy purposes.
  • HCL Forums and Blogs
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • API Documentation
Search
  • Share Show Menu▼
  • Subscribe Show Menu▼

Recent articles by this author

Community articleCreating an Xpage resource file via DXL without a temporary file
Added by ~Umberto Xanweter on September 18, 2010 | Version 1
expanded Abstract
collapsed Abstract
File resources are a great way of allowing user configurability in Xpage applications, for example field labels, configurable blocks of text or the choices for dialog boxes. This article shows how users can add configurable information through a simple form and that data can then be transferred to a resource file where it can be used by the Xpage application.
Tags: File resource, DXL, Xpages, File Resources
ShowTable of Contents
HideTable of Contents
  • 1 Introduction
  • 2 Entering the configuration
  • 3 The structure of the file resource
  • 4 Retrieving the settings
  • 5 The code to create the resource file

Introduction


In Xpages resource files can be used to store settings. This is a great way of increasing the configurability of your application ( labels, keyword choices etc )  without having to carry the overhead of frequent look-ups to Notes configuration documents. This apporach is a core part of the Steve Castledines OpenNTF Xpages Framework and has also been recommended by Matt White. 

This article describes how to create a resource file via DXL using a stream so that an intermediate file on the hard drive is not needed. The code incorporates other code from Julian Robichaux for managing the Base64 encoding.

Entering the configuration


The application has a series of configuration documents. As each is saved in the UI it calls a back end LotusScript agent which creates a file resource. The Xpage application pulls the settings directly from this file resource rather than from the documents themselves.
The system does not attempt to update the file resource but creates a new one from scratch by cycling though the view and adding information for each record.
 
 URLCreate New Article
 
 

The structure of the file resource

Note that although the structure looks straight forward it is saved as Base64. You can see this by using the Tools > DXL Utilities > Exporter tool
 
URLCreate New Article 
 

Retrieving the settings


The settings can be retrieved using the code below, note that you also need to include the file as a resource bundle 
 
URLCreate New Article 
 
URLCreate New Article  
 

The code to create the resource file

 
URLCreate New Article  
 
The crux to creating the file resource is that it is in base64 so you will need to use some code originally developed by Julian Robichaux and published on OpenNTF
I have attached the whole script library at the end of the article. The entry point called by the agent is Sub s_CreateFileResourceFromView_6_01 
 
 URLCreate New Article 
 
I have posted the code as an attachment. Apologies for not including a demo database but I would need to strip the functionality it out of a commercial system. The attached code has plenty of commenting. 
 
Sean Cull
expanded Attachments (6)
collapsed Attachments (6)
File TypeSizeFile NameCreated OnDelete file
image/gif 18 KB img1.gif 9/18/10, 8:12 PM
image/gif 20 KB img2.gif 9/18/10, 8:12 PM
image/gif 11 KB img3.gif 9/18/10, 8:13 PM
image/gif 14 KB img4.gif 9/18/10, 8:13 PM
image/gif 13 KB img5.gif 9/18/10, 8:13 PM
image/gif 46 KB img6.gif 9/18/10, 8:13 PM
expanded Versions (10)
collapsed Versions (10)
Version Comparison     
VersionDateChanged by              Summary of changes
10Oct 13, 2010, 8:57:35 AM~Chloe Chutumilen  corrected typos
9Sep 18, 2010, 8:43:07 PM~Umberto Xanweter  
8Sep 18, 2010, 8:37:52 PM~Umberto Xanweter  
7Sep 18, 2010, 8:30:02 PM~Umberto Xanweter  
6Sep 18, 2010, 8:29:33 PM~Umberto Xanweter  
5Sep 18, 2010, 8:28:39 PM~Umberto Xanweter  
4Sep 18, 2010, 8:27:47 PM~Umberto Xanweter  
3Sep 18, 2010, 8:25:11 PM~Umberto Xanweter  
2Sep 18, 2010, 8:23:59 PM~Umberto Xanweter  
This version (1)Sep 18, 2010, 8:20:01 PM~Umberto Xanweter  
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedAbout
  • HCL Software
  • HCL Digital Solutions community
  • HCL Software support
  • BlogsDigital Solutions blog
  • Community LinkHCL Software forums and blogs
  • About HCL
  • Privacy
  • Accessibility